package com.thymeleaf.controller;


import com.thymeleaf.pojo.Student;
import org.springframework.stereotype.Controller;

import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.Arrays;


/**
 * @author 从卿
 * @create 2022/4/28-14:16
 */
@Controller
public class HelloThymeleaf {
    @RequestMapping(value = "helloThymeleaf")
  public String helloThymeleaf(Model model){
        Student stu = new Student();
        stu.setName("王祖贤");
        stu.setAge("18");
        stu.setLove(true);
        stu.setAddress("北京");
        stu.setSex("2");
        stu.setStudents(Arrays.asList("王祖贤","林青霞","向涵之"));
        model.addAttribute("name","向涵之小可爱");
        model.addAttribute("result","是向涵之小可爱");
        model.addAttribute("stu",stu);
        return "hello";
    }
}
